package org.lex.ftp.ui.calculator;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.border.EmptyBorder;

import org.lex.ftp.FTP;
import org.lex.swing.widgets.EnhancedDialog;


public class CalculateDialog extends EnhancedDialog {
	private final FTP app;
	private CalculatePane pane = null;

	public static void main(String[] args) {
	}

	public CalculateDialog(final FTP app) {
		super(app.getRootWindow());
		this.app = app;
		this.initialize();
	}

	public void cancel() {
		this.dispose();
	}

	private void initialize() {
		pane = new CalculatePane(app);
		pane.setBorder(new EmptyBorder(12, 12, 11, 11));
		pane.getCloseButton().addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				cancel();
			}
		});
		this.setDefaultButton(pane.getCloseButton());
		this.setContentPane(pane);
		this.setSize(325, 245);
		this.setTitle("Size");
		this.setLocationRelativeTo(app.getRootWindow());
	}
}
